Propforth 4.0a 20101212 
20-README - mini file system  

This instruction requires the hardware test configureation described in 

21-README-3 Prop Test Configuration.TXT

If you do NOT have that configuration or if you do not want to use the mini-file system in EEPROM
(for example if you are using a demo board you don't have 64K EEPROM and can't use the mini file system)
Please use the steps described in 
30-readme - no mini file system.txt 

VERSION 4.0 - RELEASE

QA 2010 NOV 29

Some changes from the 3.x code stream.

- The IO structure has been completeley regularized. It was ok in 3.6, but as more peripherals were added,
they were somewhat divergent from the regular structure. Cogs now all adhere to the same IO structure, which makes it
very easy to connect IO.
- An optional load structure [if   ] has been added for configuration management reasons.
- A very simple file system for the 64Kx8 eeproms has been added. Thisa allows saving files to the upper part of
eeprom not used by the propeller. Can extend to use mulitiple 64kx8 eeproms, tested up to 3 64kx8 eeproms. fs.f
- fl was changed to load the file as it comes in. This takes advantage of the regular IO structure, where a COG
reads the input, and routes it to another cog. A change in behaviour, the cog which compiles the code is not the 
cog the fl command was executed on. Only important when modifying cog specific variables.

PropForth should run on just about any configuration. 
-  the mini file system fits into the extra EEPROM above 32K.  Since the DEMO BOARD EEPROM is only 32k,
this causes some issue when the mini file system is used on the demo board.  
Basically, when the mini file system writes the EEPROM on the demoboard, the boot image is being changed.
If the user is careful to only write to the area "unused" by forth, everything is ok.
Unfortunately, unless you know a lot about what is going on, this is a PITA.  
Solution: use 64k EEPROM or don't use fs.f   

STEPS: (these start at 9 to retain numbering from previous release)

9.  reboot, load the contents of fs.s into teraterm, do a saveforth, reboot
fs.f
10. type in fsclear, initializes file system
fsclear
11. copy the contents of the following files into teraterm:

23-propforth.f
24-LogicAnalyzer.f
25-asm.f
26-norom.f
27-com.f
28-comnorom.f
29-snet.f

NOTICE - the way these are set up, they load their source text into the mini file system in EEPROM
The text you see scrooling across the screen is the text beign written into EEPROM
THIS IS HANDY DURING TESTING, as the files survive in EEPROM between REBOOTS and POWER CYCLE!!!!!!
Clever huh?  Think about it for second.  This is important to consider in the next couple steps 

12. fsls - should produce the following:

fsls

008000 002272 propforth.f
00A280 000E77 LogicAnalyzer.f
00B140 0020CE asm.f
00D240 000D0F norom.f
00DF80 001426 com.f
00F3C0 000221 comnorom.f
00F600 000112 snet.f

8C0  bytes free in files system

Prop0 Cog6 ok

If you see the above,  the listed files are in EEPROM as SOURCE.  
You can do what you do, and if something blows up druring development (like it always does)
you can reload the source WITHOUT copy and pasting into the teraterm windows.  SEE?  Neat-o, eh?

13. reboot, 

13a. Load the logic analyzer from the EEPROM mini file system   

fsload LogicAnaLyzer.f

NOTICE - IF YOU HIGHLIGHT, COPY AND PASTE "fsload LogicAnaLyzer.f" into the teraterm window,
the forth prompt is displayed WITHOUT the source text scrollling down the screen 

prop0 Cog6 Ok
fsload LogicAnaLyzer.f
  
prop0 Cog6 Ok  

This is an error.  When "fsload LogicAnaLyzer.f" you should see the entire source text scroll down the screen.
Type in the string fsload LogicAnaLyzer.f to get proper operation.  

14. Type in 

c" hex a aae60 setHza b 6ACFC0 setHzb" 5 cogx 

This starts up 2 clocks on IO pins A & B  
(HEX values A and B are decimal values 10 and 11, so this is pins 10 and 11.
Check Brian Riley's drawing to make suhre this is correct). 

14a. run the logic analyzer commands to see the activity in the pins

sampleNoTrigger
sampleTrigger
sampleFourTrigger
sampleOneNoTrigger

decimal displayTriggerFrequency hex

HERE is the sequence of command line inputs and output you should see for step 14 and 14A:

Prop0 Cog6 ok

c" hex a aae60 setHza b 6ACFC0 setHzb" 5 cogx
Prop0 Cog6 ok

Prop0 Cog6 ok
sampleNoTrigger

0A-_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_-

0B__-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_-

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleTrigger

0A-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_-_--_-_-_-__-_-_

0B_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-_--_-__-

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleFourTrigger

0A_____________--------------_______________--------------______________---------------______________--------------______________---------------__________________

0B__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_--_--_-__-__-__-_--_-______

0C----------------------------------------------------------------------------------------------------------------------------------------------------------______

0D----------------------------------------------------------------------------------------------------------------------------------------------------------______

0E----------------------------------------------------------------------------------------------------------------------------------------------------------______

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
sampleOneNoTrigger

0A----------------------------------_________________________________________________________---------------------------------------------------------____________

0B----______------_____------______-----______------______-----______------_____------______------_____------______-----______------______-----______------_____--

0C----------------------------------------------------------------------------------------------------------------------------------------------------------------

0D----------------------------------------------------------------------------------------------------------------------------------------------------------------

0E----------------------------------------------------------------------------------------------------------------------------------------------------------------

0F________________________________________________________________________________________________________________________________________________________________

10________________________________________________________________________________________________________________________________________________________________

11________________________________________________________________________________________________________________________________________________________________
Prop0 Cog6 ok
decimal displayTriggerFrequency hex
701754.385
Prop0 Cog6 ok

EXPLANATION a DASH  (-) is HIGH or 1; an UNDERSCORE (_) is a LOW of 0.  Each dash or underscore repressents the state of the pin
All the pins are sampled at the same time and placed into memory until the memory runs out or the sampling is turned off.

15. reboot, 

15A. load the files from the EEPROM file system into the dictionary using "fsload com.f" 
Type the command into teraterm, don't copy and paste from this file 

fsload com.f

15B. Define the 2 following routines.  Type these in by hand to the teraterm window
You can copy and paste, but make sure they are int the dictionary using "words c" to do a dictionary dump


fl
: cominit
	c" 14 15 FF 3 commaster" 4 cogx
	c" 14 15 FF 3 comslave" 5 cogx
	100 delms
	0 0 5 0 (ioconn)
	1 0 5 1 (ioconn)
	2 0 5 2 (ioconn) ;

: comstat 4 cogio dup comcnt L@ . comerr L@ . 5 cogio dup comcnt L@ . comerr L@ . cr ;



16. type the following commands to start a terminal and connect to cog0  via the com interfaces, CTL-F exits

cominit comstat
4 0 term 

HERE is the sequence of inputs and outs you should see on the terminal for steps 15 and 16: 

Prop0 Cog6 ok

fl
: cominit
 c" 14 15 FF 3 commaster" 4 cogx
 c" 14 15 FF 3 comslave" 5 cogx
 100 delms
 0 0 5 0 (ioconn)
 1 0 5 1 (ioconn)
 2 0 5 2 (ioconn) ;
Prop0 Cog0 ok

Prop0 Cog0 ok
: comstat 4 cogio dup comcnt L@ . comerr L@ . 5 cogio dup comcnt L@ . comerr L@ . cr ;
Prop0 Cog0 ok

Prop0 Cog0 ok

Prop0 Cog6 ok
cominit comstat
CE 0 EC 0
Prop0 Cog6 ok
4 0 term
Hit CTL-F to exit term

Prop0 Cog0 ok

Prop0 Cog0 ok

Prop0 Cog0 ok
1 2 3 . . .
3 2 1 Prop0 Cog0 ok
Prop0 Cog6 ok

NOTICE in the above where the COG changes from cog6 on the master to Cog0 on the SLAVE.
SORRY, but we didn't change the ID strings for MASTER nad SLAVE yet.  
THAT is in the next step.  

ANYWAY:

THIS SET OF TESTS ALL RUN ON THE Proto Board + the 40 pin Propeller Chip

17. reboot

17a. load the norom.f file from EEPROM file system using the command

fsload norom.f

You should see the text for the source code scroll across the screen.

18. Define to following words, run demo, CTL-F to exit

fl
: bootslave 8 9 A B rambootnx ;
: demo bootslave 1 0 e100 4 startserialcog 10 delms 4 0 term ;

\ 4 0 term - will connect again after demo is run


Prop0 Cog6 ok

HERE is the sequence of inputs and outputs you should see for step 18:

fl
: bootslave 8 9 A B rambootnx ;
Prop0 Cog0 ok
: demo bootslave 1 0 e100 4 startserialcog 10 delms 4 0 term ;
Prop0 Cog0 ok

Prop0 Cog6 ok
demo
Hit CTL-F to exit term

 SLAVEProp8 Cog6 ok

 SLAVEProp8 Cog6 ok
1 2 3 . . .
3 2 1  SLAVEProp8 Cog6 ok
Prop0 Cog6 ok

NOTICE THIS IS AS FAR AS PROF_BRAINO GOT before noticing the deal with copy/paste "fsload propforth.f"
SEE Issue 18 in Code.Google.com/p/propforth/issues
Did they just change the Google Code website? 

19. reboot, 

19A. Load the comnorom.f file from the EEPROM mini file system using  the command

fsload comnorom.f

You should see the source text scroll across the display

20. run the following command sequence;  CTL-F to exit


0 onboot
5 0 term


Prop0 Cog6 ok
0 onboot
MASTERProp0 Cog6 ok
5 0 term
Hit CTL-F to exit term

 SLAVEProp8 Cog0 ok
1 2 3 . . .
3 2 1  SLAVEProp8 Cog0 ok
MASTERProp0 Cog6 ok


THIS SET OF TESTS ALL RUN ON THE Proto Board + Spinneret Board

21. reboot, load snet.f, run snet, CTL-F to exit

22. define the following words, do a saveforth, reboot
: _ob onboot ;
: onboot _ob c" SNETProp" prop W! ;


Prop0 Cog6 ok
: _ob onboot ;
Prop0 Cog6 ok
: onboot _ob c" SNETProp" prop W! ;
Prop0 Cog6 ok
saveforth
..........................................................................................................................................................
Prop0 Cog6 ok
reboot
RESET SNETProp0 Cog6 ok

SNETProp0 Cog6 ok
1 2 3 . . .
3 2 1 SNETProp0 Cog6 ok

SNETProp0 Cog6 ok
Prop0 Cog6 ok

